package com.nbjtjc.safe.oss.service;

import com.nbjtjc.safe.service.sys.SysFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

/**
 * @auther guqianbin
 * @date 2018/11/21 10:40
 **/
@Service
public  class OSSFactory {
    @Value("${aliyun.oss.endPoint}")
    private  String endPoint;
    @Value("${aliyun.oss.accessKeyId}")
    private  String accessKeyId;
    @Value("${aliyun.oss.accessSeySecret}")
    private  String accessSeySecret;
    @Value("${aliyun.oss.bucketName}")
    private  String bucketName;
    @Value("${aliyun.oss.domain}")
    private  String domain;
    @Value("${aliyun.oss.prefix}")
    private  String prefix;

    @Value("${aliyun.oss.callbackUrl}")
    private String callbackUrl;
    @Autowired
    private SysFileService sysFileService;
    public  AliyunCloudStorageService build(){
        return new AliyunCloudStorageService(endPoint,accessKeyId
                ,accessSeySecret,bucketName
                ,domain,prefix,callbackUrl,sysFileService);
    }

}
